Adding New Check: Schema Validation check#568
Merged
Conversation
Contributor
|
✅ 307/307 passed, 4 flaky, 1 skipped, 2h56m9s total Flaky tests:
Running from acceptance #2365 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds the dataset-level check function has_valid_schema to validate that the checked DataFrame matches the specified schema. The function supports both permissive and strict validation modes, with optional column filtering.
- Adds
has_valid_schemafunction with schema validation logic and type compatibility checking - Implements comprehensive test coverage including unit, integration, and performance tests
- Updates documentation with usage examples and parameter descriptions
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/perf/test_apply_checks.py | Adds performance tests for schema validation checks |
| tests/perf/.benchmarks/baseline.json | Updates baseline performance metrics with new schema validation benchmarks |
| tests/integration/test_dataset_checks.py | Adds comprehensive integration tests covering various schema validation scenarios |
| src/databricks/labs/dqx/llm/resources/yaml_checks_examples.yml | Adds YAML configuration examples for schema validation checks |
| src/databricks/labs/dqx/check_funcs.py | Implements the core schema validation functionality and helper functions |
| docs/dqx/docs/reference/quality_checks.mdx | Updates documentation with schema validation check reference and examples |
| docs/dqx/docs/reference/benchmarks.mdx | Updates benchmark results to include schema validation performance metrics |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
mwojtyczka
requested changes
Sep 15, 2025
mwojtyczka
reviewed
Sep 16, 2025
mwojtyczka
reviewed
Sep 16, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Introduces the dataset-level check function
has_valid_schema, which validates that a DataFrame conforms to the specified schema.Results are reported in the same format as other checks, i.e., at the row level. While this results in duplicated messages (since the same validation outcome is repeated for all rows), it ensures consistency on how quality issues are reported.
Linked issues
Resolves #159
Tests